﻿package com.fecesaids.greatgame {
	import flash.events.EventDispatcher;
	import flash.events.Event;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	public class Communication extends MovieClip {
		private var _modHealthAmount:int;
		private var _modName:String;
		private var _modAvatar:MovieClip;
		private var _newItemData:Array;
		private var _remItemData:Array;
		private var _hasItemInInventory:Boolean;
		private var _itemToCheckForData:Array;
		private var _gameToLoadData:Array;
		public function Communication() {
		}
		public function modHealth(modValue:int) {
			_modHealthAmount = modValue;
			dispatchEvent(new Event("modHealth"));
		}
		public function modName(modValue:String) {
			_modName = modValue;
			dispatchEvent(new Event("modName"));
		}
		public function modAvatar(modValue:MovieClip) {
			_modAvatar = modValue;
			dispatchEvent(new Event("modAvatar"));
		}
		public function addInvItem(itemData:Array):void{
			_newItemData = itemData;
			dispatchEvent(new Event("addInvItem"));
		}
		public function remInvItem(remItemData){
			_remItemData = remItemData;
			dispatchEvent(new Event("remInvItem"));
		}
		public function hasItem(dingle:Array):Boolean {
			_hasItemInInventory = false;
			_itemToCheckForData = dingle;
			dispatchEvent(new Event("hasItem"));
			return _hasItemInInventory;
		}
		public function loadGame(gameData:Array):void {
			_gameToLoadData = gameData;
			dispatchEvent(new Event("loadGame"));
		}
		public function getGameData():Array {
			return _gameToLoadData;
		}
		public function setHasItem(bool:Boolean){
			_hasItemInInventory = bool;
		}
		public function getItemToCheckFor():Array{
			return _itemToCheckForData;
		}
		public function getNewItemData() {
			return _newItemData;
		}
		public function getRemItemData() {
			return _remItemData;
		}
		public function getModName() {
			return _modName;
		}
		public function getModHealth() {
			return _modHealthAmount;
		}
		public function getAvatar() {
			return _modAvatar;
		}
	}
}